package com.cool.modules.finance.entity.account;

import com.cool.core.base.BaseEntity;
import com.cool.modules.finance.constant.InOrOutType;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Table;
import com.tangzc.mybatisflex.autotable.annotation.ColumnDefine;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 转账记录表
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Table(value = "finance_transfer_account")
public class FinanceTransferAccountEntity extends BaseEntity<FinanceTransferAccountEntity> {

    @ColumnDefine(comment = "转账类型(1-转账,2-赎回,3-还款)",notNull = true,type = "int(11)")
    private Integer transferType;

    @Column(ignore = true)
    private String transferTypeText;

    /**
     * 对于当前查询账户，是转入还是转出
     */
    @Column(ignore = true)
    private InOrOutType inOrOut;

    @Column(ignore = true)
    private String inOrOutText;

    @ColumnDefine(comment = "出账账户",notNull = true,type = "bigint")
    private Long outAccount;

    @Column(ignore = true)
    private String outAccountName;

    @ColumnDefine(comment = "入账账户",notNull = true,type = "bigint")
    private Long inAccount;

    @Column(ignore = true)
    private String inAccountName;

    @Column(ignore = true)
    private String inAccountCoinName;

    @Column(ignore = true)
    private String inAccountCoinSymbol;

    @ColumnDefine(comment = "转账金额",notNull = true,type = "decimal(10,2)")
    private BigDecimal repayMoney;

    @ColumnDefine(comment = "出账用户",notNull = true,type = "bigint")
    private Long outAccountUserId;

    @ColumnDefine(comment = "入账用户",notNull = true,type = "bigint")
    private Long inAccountUserId;

    @Column(ignore = true)
    private String outAccountUserName;

    @Column(ignore = true)
    private String inAccountUserName;

    @ColumnDefine(comment = "还款原因",type = "text")
    private String repayReason;

    @ColumnDefine(comment = "是否删除",defaultValue = "false",type = "tinyint(1)")
    private Boolean isDel;

    @ColumnDefine(comment = "转账时间")
    private Date transferTime;
}
